<?xml version="1.0" encoding="utf-8" ?>
<sqlMap namespace="DicItem" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<alias>
    <typeAlias alias="DicItem" type="EIA.Basic.Model.DicItem, EIA.Basic.Model" />
</alias>

<resultMaps>
<resultMap id="select-dicitem-result" class="DicItem">
<constructor>
    <argument argumentName="dic_tid" column="dic_tid"/>
    <argument argumentName="dic_iid" column="dic_iid"/>
    <argument argumentName="dic_iname" column="dic_iname"/>
    <argument argumentName="dic_ides" column="dic_ides"/>
</constructor>
<!--
    <result property="DicTid" column="dic_tid"/>
    <result property="DicIid" column="dic_iid"/>
    <result property="DicIname" column="dic_iname"/>
    <result property="DicIdes" column="dic_ides"/>
-->
</resultMap>
</resultMaps>

<statements>
<sql id="sql_DicItem_where_pk">
WHERE dic_tid=#DicTid# AND dic_iid=#DicIid#
</sql>

<sql id="sql_DicItem_where_cv">
<dynamic prepend="WHERE">
    <isPropertyAvailable property="DicTid" prepend="AND">dic_tid LIKE concat('%', #DicTid#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="DicIid" prepend="AND">dic_iid=#DicIid#</isPropertyAvailable>
    <isPropertyAvailable property="DicIname" prepend="AND">dic_iname LIKE concat('%', #DicIname#, '%')</isPropertyAvailable>
    <isPropertyAvailable property="DicIdes" prepend="AND">dic_ides LIKE concat('%', #DicIdes#, '%')</isPropertyAvailable>
</dynamic>
</sql>

<sql id="sql_DicItem_set_cols">
<dynamic prepend="SET">
    <isPropertyAvailable property="DicIname" prepend=",">dic_iname=#DicIname#</isPropertyAvailable>
    <isPropertyAvailable property="DicIdes" prepend=",">dic_ides=#DicIdes#</isPropertyAvailable>
</dynamic>
</sql>

<select id="SelectDicItem" parameterClass="" resultMap="DicItem.select-dicitem-result">
SELECT *
FROM dic_item
<include refid="sql_DicItem_where_pk"/><!--where-->
</select>

<select id="SelectDicItem_CV" parameterClass="System.Collections.IDictionary" resultMap="DicItem.select-dicitem-result">
SELECT *
FROM dic_item
<include refid="sql_DicItem_where_cv"/><!--where-->
</select>

<insert id="InsertDicItem" parameterClass="DicItem">
<!--pre selectKey place-->
INSERT INTO dic_item(
<dynamic prepend=" ">
    <isPropertyAvailable property="DicTid" prepend=",">dic_tid</isPropertyAvailable>
    <isPropertyAvailable property="DicIid" prepend=",">dic_iid</isPropertyAvailable>
    <isPropertyAvailable property="DicIname" prepend=",">dic_iname</isPropertyAvailable>
    <isPropertyAvailable property="DicIdes" prepend=",">dic_ides</isPropertyAvailable>
</dynamic>
)VALUES(
<dynamic prepend=" ">
    <isPropertyAvailable property="DicTid" prepend=",">#DicTid#</isPropertyAvailable>
    <isPropertyAvailable property="DicIid" prepend=",">#DicIid#</isPropertyAvailable>
    <isPropertyAvailable property="DicIname" prepend=",">#DicIname#</isPropertyAvailable>
    <isPropertyAvailable property="DicIdes" prepend=",">#DicIdes#</isPropertyAvailable>
</dynamic>
)
<!--post selectKey place-->
</insert>

<update id="UpdateDicItem" parameterClass="System.Collections.IDictionary">
UPDATE dic_item
<include refid="sql_DicItem_set_cols"/><!--set-->
<include refid="sql_DicItem_where_pk"/><!--where-->
</update>

<delete id="DeleteDicItem" parameterClass="">
DELETE FROM dic_item
<include refid="sql_DicItem_where_pk"/><!--where-->
</delete>

<statement id="DeleteDicItem_CV" parameterClass="DicItem">
DELETE FROM dic_item
<include refid="sql_DicItem_where_cv"/><!--where-->
</statement>

<delete id="ClearDicItem">
DELETE FROM dic_item
</delete>
</statements>
</sqlMap>